Frequently, VAX MACRO source code must save and restore register
values, because that is part of the defined interface or because
the code requires work registers.
On OpenVMS VAX, code can invoke any number of macros to do
this. On OpenVMS Alpha and OpenVMS I64, you cannot simply
replace these macros with 64-bit pushes and pops to and from
the stack, because there is no guarantee that the macro caller
has a quadword-aligned stack. Instead, you should replace such
macro invocations with $PUSH64 and $POP64 macros. These macros,
located in STARLET.MLB, preserve all 64 bits of a register but
use longword references to do so.
1 – $POP64
Pops the 64-bit value on the top of the stack into a register.
Format
$POP64 reg
1.1 – Parameters
reg
Register into which the macro places the 64-bit value from the
top of the stack.
1.2 – Description
$POP64 takes the 64-bit value at the top of the stack and places
it in a register using longword instructions. This is to avoid
using quadword instructions when an alignment fault should be
avoided, but restoring all 64 bits is necessary.
2 – $PUSH64
Pushes the contents of a 64-bit register onto the stack.
Format
$PUSH64 reg
2.1 – Parameters
reg
Register to be pushed onto the stack.
2.2 – Description
$PUSH64 takes a 64-bit register and puts it on the stack
using longword instructions. This is to avoid using quadword
instructions when an alignment fault should be avoided, but
saving all 64 bits is necessary.